import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JTextField;

public class StatusPanel extends JPanel {
	
	private JTextField nodeTitle;
	private JTextField sizeRom;
	private JTextField sizeRam;
	private JTextField comments;
	private JProgressBar pb;
	
	public StatusPanel() {
		super(new GridLayout(1,5));
		
		nodeTitle = new JTextField("");
		sizeRom = new JTextField("");
		sizeRam = new JTextField("");
		pb = new JProgressBar(0, 100);
		pb.setValue(0);
        //Call setStringPainted now so that the progress bar height
        //stays the same whether or not the string is shown.
		pb.setStringPainted(true);
		
		comments = new JTextField("Remarks: Values are in items of Bytes");
				
		nodeTitle.setEditable(false);
		sizeRom.setEditable(false);
		sizeRam.setEditable(false);
		comments.setEditable(false);
		
		add(nodeTitle);
		add(sizeRam);
		add(sizeRom);
		add(pb);
		add(comments);

		sizeRom.setToolTipText("Values are in items of Bytes");
		sizeRam.setToolTipText("Values are in items of Bytes");
		comments.setToolTipText("Remarks: Values are in items of Bytes");
		
	}
	
	public void setNodeTitle(String value) {
		nodeTitle.setText(value);
	}
	
	public void setSizeRom(String value) {
		sizeRom.setText("Rom: " + value);
	}
	
	public void setSizeRam(String value) {
		sizeRam.setText("Ram: " + value);
	}
	
	public void setProgressRange(int min, int max) {
		pb.setMinimum(min);
		pb.setMaximum(max);
	}
	
	public void setProgress(int value) {
		pb.setValue(value);
	}
	
	public JProgressBar getProgressBar() {
		return pb;
	}
	
}
